package com.iguo.tube.form;

import com.iguo.tube.model.Point;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Edge  implements Serializable {
  private static final long serialVersionUID = 1L;

  private Point fromPoint;
  private Point toPoint;
  private int distance;

  public Edge deepCopy() {
    Point fromPointCopy = fromPoint != null ? fromPoint.deepCopy() : null;
    Point toPointCopy = toPoint != null ? toPoint.deepCopy() : null;
    return new Edge(fromPointCopy, toPointCopy, this.distance);
  }

}
